package com.launch.wlfw.controller;

import com.launch.wlfw.dto.CountDTO;
import com.launch.wlfw.service.CountService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class CountController {

    @Resource
    private CountService countService;

    @RequestMapping("/statisticIndex")
    public ModelAndView statisticIndex() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/count/statisticIndex");
        List<CountDTO> countDTOS = countService.selectCount();
        modelAndView.addObject("list",countDTOS);
        return modelAndView;
    }
}
